﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CashierSystem.UserManager;

namespace CashierSystem.CashierInManager
{
    public partial class SaleCardForm : Form
    {
        User user;
        string customerId;
        public SaleCardForm(User user,string customerId)
        {
            this.user = user;
            this.customerId = customerId;
            InitializeComponent();
        }

        private void SaleCardForm_Load(object sender, EventArgs e)
        {
            label1.Text = CashierInManager.loadOneCustomerName(customerId);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string cardType = cbCardType.Text;
            string price = tbPrice.Text;
            string times = tbTimes.Text;
            string cardId = tbCardId.Text;
            string actualPrice = tbActual.Text;
            string endDate = tbEndDate.Text;
            CashierInManager.saveSaleCard(cardId, customerId, cardType, price, times, actualPrice,endDate);
            DialogResult response = MessageBox.Show("操作成功！");
        }

        private void dtpEndDate_ValueChanged(object sender, EventArgs e)
        {
            tbEndDate.Text = dtpEndDate.Value.Date.ToString();
        }


    }
}